package com.yonyou.pmclouds.projectstatus.util;

import com.yonyou.pmclouds.projectstatus.entity.ProjectStatusVO;

import static com.yonyou.pmclouds.project.entity.ProjectConst.*;

public class ProjectStatusUtils {
    /**
     * 根据nc端的状态分类，转换成友工程的项目状态分类
     */
    public static byte getTransStatus(ProjectStatusVO statusVO) {
        byte status = STATE_GOING;
        switch (statusVO.getStateSort()) {
            case OUTER_STATUS_SORT_BUZI_FINISH:
            case OUTER_STATUS_SORT_ACC_FINISH:
            case OUTER_STATUS_SORT_END:
                status = STATE_END;
                break;
            case OUTER_STATUS_SORT_PUBLISHED:
                status = STATE_GOING;
                break;
            case OUTER_STATUS_SORT_CREATED:
                status = STATE_CREATED;
                break;
            case OUTER_STATUS_SORT_PAUSE:
                status = STATE_PAUSE;
                break;
            default:
                break;
        }
        return status;
    }
}
